#ifndef  CLIENT
#define CLIENT
#include"../Global.h"
#include"HSocket.h"
#include"RecFrameServer.h"
#include"SendFrameClient.h"
#include"../CommonUtils/ClientUtils.h"
#include"CommonUtils/ThreadPool/HzThreadPool.h"
#include "Domain/ClientMsg/LoginMsg.pb.h"
#include "Domain/ClientMsg/MainMsg.pb.h"
#include <QObject>
class RemoteClient:public QObject,public HClientBase
{
    Q_OBJECT
public:
    RemoteClient(int flag);
    ~RemoteClient();
signals:
    //通知登陆状态
    void noteLogSucess(string code);
    //通知开启远程状态
    void noteRemoteCtlStatus(int status);

 /*
  * 发送请求给服务器
*/
public:
    //请求连接服务器
    int startClient(shared_ptr<ServerMsg::LoginMsg> LoginMsgPtr);
    // 请求远程控制
    int reqRemoteCtl(string remoteCode);
    // 请求关闭远程控制
    int reqCloseRemoteCtl();
    // 开启接收屏幕截图的服务端
    int openRevFrameSvr();


/*
 * 处理服务器发来的事件
*/
public:
    //处理登陆响应
    int headLogSucess(void* arg);
    //处理开启远程响应
    int headRemoteCtl(void* arg);
    // 开启远程控制
    int headOpenRemote(void* arg);
    // 关闭远程控制
    int headCloseRemote(void* arg);
    //开启发送屏幕截图的客户端
    int openSendFrameCli(string ip);
public:

public:
    HzThreadPool* pools;
    //发送屏幕截图的客户端
    SendFrameClient* sendFraCli;
    //接收屏幕截图的服务端
    RecFrameServer* recFraSrv;
};

#endif // ! CLIENT
